#include "p24F04KA200.h"
#include "uart.h"
#include "../common/util.h"

char* itoa(unsigned int val, unsigned base) {

    static char buf[32] = {0};
    unsigned i = 30;

    if (val == 0)
        return "0";

    for (; val && i; --i, val /= base)
        buf[i] = "0123456789abcdef"[val % base];

    return &buf[i + 1];
}


void writeVT100Cmd(char *cmd) {
    write(ASCII_escape_char);
    writeStr(cmd);
}